package com.xindaoapp.framework.api;

import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.AsyncHttpResponseHandler;
import com.loopj.android.http.RequestParams;
import com.xindaoapp.framework.utils.CommonLog;

public class AddClient {
	protected static CommonLog log = new CommonLog();
	public static AsyncHttpClient client = new AsyncHttpClient();
	public static AsyncHttpClient getClient() {
		return client;
	}
	public static void get(String url, RequestParams params, AsyncHttpResponseHandler responseHandler) {
		log.i(url);
		if (ConstantsValue.cookieStore != null) {
			client.setCookieStore(ConstantsValue.cookieStore);
		}
		client.get(url, params, responseHandler);
	}
	public static void post(String url, RequestParams params, AsyncHttpResponseHandler responseHandler) {
		log.i(url);
		if (ConstantsValue.cookieStore != null) {
			client.setCookieStore(ConstantsValue.cookieStore);
		}
		client.post(url, params, responseHandler);

	}

}
